<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //JS如何判断一个对象是否属于一个类
    //类本身指向构造函数，类的数据类型就是函数
    function Person(name) {
      this.name = name
    }
    let obj = new Person('张三')
    //instanceOf:判断构造函数的prototype属性是否出现在对象的原型链的任何位置
    console.log(obj instanceof Person);
  </script>
</body>

</html>